;;! simd = true

(module
  (memory 1)

  (func (export "1-byte-from-end") (param i32)
    (drop (call $v128.load8_splat (local.get 0)))

    (drop (call $v128.load8_lane_0 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load8_lane_1 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load8_lane_2 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load8_lane_3 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load8_lane_4 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load8_lane_5 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load8_lane_6 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load8_lane_7 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load8_lane_8 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load8_lane_9 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load8_lane_10 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load8_lane_11 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load8_lane_12 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load8_lane_13 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load8_lane_14 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load8_lane_15 (local.get 0) (v128.const i64x2 0 0)))

    (call $v128.store8_lane_0 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store8_lane_1 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store8_lane_2 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store8_lane_3 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store8_lane_4 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store8_lane_5 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store8_lane_6 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store8_lane_7 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store8_lane_8 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store8_lane_9 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store8_lane_10 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store8_lane_11 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store8_lane_12 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store8_lane_13 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store8_lane_14 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store8_lane_15 (local.get 0) (v128.const i64x2 0 0))

    (drop (call $i8x16.replace_lane_0 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i8x16.replace_lane_1 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i8x16.replace_lane_2 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i8x16.replace_lane_3 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i8x16.replace_lane_4 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i8x16.replace_lane_5 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i8x16.replace_lane_6 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i8x16.replace_lane_7 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i8x16.replace_lane_8 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i8x16.replace_lane_9 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i8x16.replace_lane_10 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i8x16.replace_lane_11 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i8x16.replace_lane_12 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i8x16.replace_lane_13 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i8x16.replace_lane_14 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i8x16.replace_lane_15 (v128.const i64x2 0 0) (local.get 0)))

    (call $i8x16.extract_lane_0  (local.get 0) (v128.const i64x2 0 0))
    (call $i8x16.extract_lane_1  (local.get 0) (v128.const i64x2 0 0))
    (call $i8x16.extract_lane_2  (local.get 0) (v128.const i64x2 0 0))
    (call $i8x16.extract_lane_3  (local.get 0) (v128.const i64x2 0 0))
    (call $i8x16.extract_lane_4  (local.get 0) (v128.const i64x2 0 0))
    (call $i8x16.extract_lane_5  (local.get 0) (v128.const i64x2 0 0))
    (call $i8x16.extract_lane_6  (local.get 0) (v128.const i64x2 0 0))
    (call $i8x16.extract_lane_7  (local.get 0) (v128.const i64x2 0 0))
    (call $i8x16.extract_lane_8  (local.get 0) (v128.const i64x2 0 0))
    (call $i8x16.extract_lane_9  (local.get 0) (v128.const i64x2 0 0))
    (call $i8x16.extract_lane_10 (local.get 0) (v128.const i64x2 0 0))
    (call $i8x16.extract_lane_11 (local.get 0) (v128.const i64x2 0 0))
    (call $i8x16.extract_lane_12 (local.get 0) (v128.const i64x2 0 0))
    (call $i8x16.extract_lane_13 (local.get 0) (v128.const i64x2 0 0))
    (call $i8x16.extract_lane_14 (local.get 0) (v128.const i64x2 0 0))
    (call $i8x16.extract_lane_15 (local.get 0) (v128.const i64x2 0 0))
  )

  (func $v128.load8_splat (param i32) (result v128) (v128.load8_splat (local.get 0)) return)

  (func $v128.load8_lane_0 (param i32 v128) (result v128) (v128.load8_lane 0 (local.get 0) (local.get 1)) return)
  (func $v128.load8_lane_1 (param i32 v128) (result v128) (v128.load8_lane 1 (local.get 0) (local.get 1)) return)
  (func $v128.load8_lane_2 (param i32 v128) (result v128) (v128.load8_lane 2 (local.get 0) (local.get 1)) return)
  (func $v128.load8_lane_3 (param i32 v128) (result v128) (v128.load8_lane 3 (local.get 0) (local.get 1)) return)
  (func $v128.load8_lane_4 (param i32 v128) (result v128) (v128.load8_lane 4 (local.get 0) (local.get 1)) return)
  (func $v128.load8_lane_5 (param i32 v128) (result v128) (v128.load8_lane 5 (local.get 0) (local.get 1)) return)
  (func $v128.load8_lane_6 (param i32 v128) (result v128) (v128.load8_lane 6 (local.get 0) (local.get 1)) return)
  (func $v128.load8_lane_7 (param i32 v128) (result v128) (v128.load8_lane 7 (local.get 0) (local.get 1)) return)
  (func $v128.load8_lane_8 (param i32 v128) (result v128) (v128.load8_lane 8 (local.get 0) (local.get 1)) return)
  (func $v128.load8_lane_9 (param i32 v128) (result v128) (v128.load8_lane 9 (local.get 0) (local.get 1)) return)
  (func $v128.load8_lane_10 (param i32 v128) (result v128) (v128.load8_lane 10 (local.get 0) (local.get 1)) return)
  (func $v128.load8_lane_11 (param i32 v128) (result v128) (v128.load8_lane 11 (local.get 0) (local.get 1)) return)
  (func $v128.load8_lane_12 (param i32 v128) (result v128) (v128.load8_lane 12 (local.get 0) (local.get 1)) return)
  (func $v128.load8_lane_13 (param i32 v128) (result v128) (v128.load8_lane 13 (local.get 0) (local.get 1)) return)
  (func $v128.load8_lane_14 (param i32 v128) (result v128) (v128.load8_lane 14 (local.get 0) (local.get 1)) return)
  (func $v128.load8_lane_15 (param i32 v128) (result v128) (v128.load8_lane 15 (local.get 0) (local.get 1)) return)

  (func $v128.store8_lane_0 (param i32 v128) (v128.store8_lane 0 (local.get 0) (local.get 1)) return)
  (func $v128.store8_lane_1 (param i32 v128) (v128.store8_lane 1 (local.get 0) (local.get 1)) return)
  (func $v128.store8_lane_2 (param i32 v128) (v128.store8_lane 2 (local.get 0) (local.get 1)) return)
  (func $v128.store8_lane_3 (param i32 v128) (v128.store8_lane 3 (local.get 0) (local.get 1)) return)
  (func $v128.store8_lane_4 (param i32 v128) (v128.store8_lane 4 (local.get 0) (local.get 1)) return)
  (func $v128.store8_lane_5 (param i32 v128) (v128.store8_lane 5 (local.get 0) (local.get 1)) return)
  (func $v128.store8_lane_6 (param i32 v128) (v128.store8_lane 6 (local.get 0) (local.get 1)) return)
  (func $v128.store8_lane_7 (param i32 v128) (v128.store8_lane 7 (local.get 0) (local.get 1)) return)
  (func $v128.store8_lane_8 (param i32 v128) (v128.store8_lane 8 (local.get 0) (local.get 1)) return)
  (func $v128.store8_lane_9 (param i32 v128) (v128.store8_lane 9 (local.get 0) (local.get 1)) return)
  (func $v128.store8_lane_10 (param i32 v128) (v128.store8_lane 10 (local.get 0) (local.get 1)) return)
  (func $v128.store8_lane_11 (param i32 v128) (v128.store8_lane 11 (local.get 0) (local.get 1)) return)
  (func $v128.store8_lane_12 (param i32 v128) (v128.store8_lane 12 (local.get 0) (local.get 1)) return)
  (func $v128.store8_lane_13 (param i32 v128) (v128.store8_lane 13 (local.get 0) (local.get 1)) return)
  (func $v128.store8_lane_14 (param i32 v128) (v128.store8_lane 14 (local.get 0) (local.get 1)) return)
  (func $v128.store8_lane_15 (param i32 v128) (v128.store8_lane 15 (local.get 0) (local.get 1)) return)

  (func $i8x16.replace_lane_0 (param v128 i32) (result v128) (i8x16.replace_lane 0 (local.get 0) (i32.load8_u (local.get 1))) return)
  (func $i8x16.replace_lane_1 (param v128 i32) (result v128) (i8x16.replace_lane 1 (local.get 0) (i32.load8_u (local.get 1))) return)
  (func $i8x16.replace_lane_2 (param v128 i32) (result v128) (i8x16.replace_lane 2 (local.get 0) (i32.load8_u (local.get 1))) return)
  (func $i8x16.replace_lane_3 (param v128 i32) (result v128) (i8x16.replace_lane 3 (local.get 0) (i32.load8_u (local.get 1))) return)
  (func $i8x16.replace_lane_4 (param v128 i32) (result v128) (i8x16.replace_lane 4 (local.get 0) (i32.load8_u (local.get 1))) return)
  (func $i8x16.replace_lane_5 (param v128 i32) (result v128) (i8x16.replace_lane 5 (local.get 0) (i32.load8_u (local.get 1))) return)
  (func $i8x16.replace_lane_6 (param v128 i32) (result v128) (i8x16.replace_lane 6 (local.get 0) (i32.load8_u (local.get 1))) return)
  (func $i8x16.replace_lane_7 (param v128 i32) (result v128) (i8x16.replace_lane 7 (local.get 0) (i32.load8_u (local.get 1))) return)
  (func $i8x16.replace_lane_8 (param v128 i32) (result v128) (i8x16.replace_lane 8 (local.get 0) (i32.load8_u (local.get 1))) return)
  (func $i8x16.replace_lane_9 (param v128 i32) (result v128) (i8x16.replace_lane 9 (local.get 0) (i32.load8_u (local.get 1))) return)
  (func $i8x16.replace_lane_10 (param v128 i32) (result v128) (i8x16.replace_lane 10 (local.get 0) (i32.load8_u (local.get 1))) return)
  (func $i8x16.replace_lane_11 (param v128 i32) (result v128) (i8x16.replace_lane 11 (local.get 0) (i32.load8_u (local.get 1))) return)
  (func $i8x16.replace_lane_12 (param v128 i32) (result v128) (i8x16.replace_lane 12 (local.get 0) (i32.load8_u (local.get 1))) return)
  (func $i8x16.replace_lane_13 (param v128 i32) (result v128) (i8x16.replace_lane 13 (local.get 0) (i32.load8_u (local.get 1))) return)
  (func $i8x16.replace_lane_14 (param v128 i32) (result v128) (i8x16.replace_lane 14 (local.get 0) (i32.load8_u (local.get 1))) return)
  (func $i8x16.replace_lane_15 (param v128 i32) (result v128) (i8x16.replace_lane 15 (local.get 0) (i32.load8_u (local.get 1))) return)

  (func $i8x16.extract_lane_0  (param i32 v128) (i32.store8 (local.get 0) (i8x16.extract_lane_u  0 (local.get 1))) return)
  (func $i8x16.extract_lane_1  (param i32 v128) (i32.store8 (local.get 0) (i8x16.extract_lane_u  1 (local.get 1))) return)
  (func $i8x16.extract_lane_2  (param i32 v128) (i32.store8 (local.get 0) (i8x16.extract_lane_u  2 (local.get 1))) return)
  (func $i8x16.extract_lane_3  (param i32 v128) (i32.store8 (local.get 0) (i8x16.extract_lane_u  3 (local.get 1))) return)
  (func $i8x16.extract_lane_4  (param i32 v128) (i32.store8 (local.get 0) (i8x16.extract_lane_u  4 (local.get 1))) return)
  (func $i8x16.extract_lane_5  (param i32 v128) (i32.store8 (local.get 0) (i8x16.extract_lane_u  5 (local.get 1))) return)
  (func $i8x16.extract_lane_6  (param i32 v128) (i32.store8 (local.get 0) (i8x16.extract_lane_u  6 (local.get 1))) return)
  (func $i8x16.extract_lane_7  (param i32 v128) (i32.store8 (local.get 0) (i8x16.extract_lane_u  7 (local.get 1))) return)
  (func $i8x16.extract_lane_8  (param i32 v128) (i32.store8 (local.get 0) (i8x16.extract_lane_u  8 (local.get 1))) return)
  (func $i8x16.extract_lane_9  (param i32 v128) (i32.store8 (local.get 0) (i8x16.extract_lane_u  9 (local.get 1))) return)
  (func $i8x16.extract_lane_10 (param i32 v128) (i32.store8 (local.get 0) (i8x16.extract_lane_u 10 (local.get 1))) return)
  (func $i8x16.extract_lane_11 (param i32 v128) (i32.store8 (local.get 0) (i8x16.extract_lane_u 11 (local.get 1))) return)
  (func $i8x16.extract_lane_12 (param i32 v128) (i32.store8 (local.get 0) (i8x16.extract_lane_u 12 (local.get 1))) return)
  (func $i8x16.extract_lane_13 (param i32 v128) (i32.store8 (local.get 0) (i8x16.extract_lane_u 13 (local.get 1))) return)
  (func $i8x16.extract_lane_14 (param i32 v128) (i32.store8 (local.get 0) (i8x16.extract_lane_u 14 (local.get 1))) return)
  (func $i8x16.extract_lane_15 (param i32 v128) (i32.store8 (local.get 0) (i8x16.extract_lane_u 15 (local.get 1))) return)

  (func (export "2-byte-from-end") (param i32)
    (drop (call $v128.load16_splat (local.get 0)))

    (drop (call $v128.load16_lane_0 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load16_lane_1 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load16_lane_2 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load16_lane_3 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load16_lane_4 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load16_lane_5 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load16_lane_6 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load16_lane_7 (local.get 0) (v128.const i64x2 0 0)))

    (call $v128.store16_lane_0 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store16_lane_1 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store16_lane_2 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store16_lane_3 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store16_lane_4 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store16_lane_5 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store16_lane_6 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store16_lane_7 (local.get 0) (v128.const i64x2 0 0))

    (drop (call $i16x8.replace_lane_0 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i16x8.replace_lane_1 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i16x8.replace_lane_2 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i16x8.replace_lane_3 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i16x8.replace_lane_4 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i16x8.replace_lane_5 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i16x8.replace_lane_6 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i16x8.replace_lane_7 (v128.const i64x2 0 0) (local.get 0)))

    (call $i16x8.extract_lane_0 (local.get 0) (v128.const i64x2 0 0))
    (call $i16x8.extract_lane_1 (local.get 0) (v128.const i64x2 0 0))
    (call $i16x8.extract_lane_2 (local.get 0) (v128.const i64x2 0 0))
    (call $i16x8.extract_lane_3 (local.get 0) (v128.const i64x2 0 0))
    (call $i16x8.extract_lane_4 (local.get 0) (v128.const i64x2 0 0))
    (call $i16x8.extract_lane_5 (local.get 0) (v128.const i64x2 0 0))
    (call $i16x8.extract_lane_6 (local.get 0) (v128.const i64x2 0 0))
    (call $i16x8.extract_lane_7 (local.get 0) (v128.const i64x2 0 0))
  )

  (func $v128.load16_splat (param i32) (result v128) (v128.load16_splat (local.get 0)) return)

  (func $v128.load16_lane_0 (param i32 v128) (result v128) (v128.load16_lane 0 (local.get 0) (local.get 1)) return)
  (func $v128.load16_lane_1 (param i32 v128) (result v128) (v128.load16_lane 1 (local.get 0) (local.get 1)) return)
  (func $v128.load16_lane_2 (param i32 v128) (result v128) (v128.load16_lane 2 (local.get 0) (local.get 1)) return)
  (func $v128.load16_lane_3 (param i32 v128) (result v128) (v128.load16_lane 3 (local.get 0) (local.get 1)) return)
  (func $v128.load16_lane_4 (param i32 v128) (result v128) (v128.load16_lane 4 (local.get 0) (local.get 1)) return)
  (func $v128.load16_lane_5 (param i32 v128) (result v128) (v128.load16_lane 5 (local.get 0) (local.get 1)) return)
  (func $v128.load16_lane_6 (param i32 v128) (result v128) (v128.load16_lane 6 (local.get 0) (local.get 1)) return)
  (func $v128.load16_lane_7 (param i32 v128) (result v128) (v128.load16_lane 7 (local.get 0) (local.get 1)) return)

  (func $v128.store16_lane_0 (param i32 v128) (v128.store16_lane 0 (local.get 0) (local.get 1)) return)
  (func $v128.store16_lane_1 (param i32 v128) (v128.store16_lane 1 (local.get 0) (local.get 1)) return)
  (func $v128.store16_lane_2 (param i32 v128) (v128.store16_lane 2 (local.get 0) (local.get 1)) return)
  (func $v128.store16_lane_3 (param i32 v128) (v128.store16_lane 3 (local.get 0) (local.get 1)) return)
  (func $v128.store16_lane_4 (param i32 v128) (v128.store16_lane 4 (local.get 0) (local.get 1)) return)
  (func $v128.store16_lane_5 (param i32 v128) (v128.store16_lane 5 (local.get 0) (local.get 1)) return)
  (func $v128.store16_lane_6 (param i32 v128) (v128.store16_lane 6 (local.get 0) (local.get 1)) return)
  (func $v128.store16_lane_7 (param i32 v128) (v128.store16_lane 7 (local.get 0) (local.get 1)) return)

  (func $i16x8.replace_lane_0 (param v128 i32) (result v128) (i16x8.replace_lane 0 (local.get 0) (i32.load16_u (local.get 1))) return)
  (func $i16x8.replace_lane_1 (param v128 i32) (result v128) (i16x8.replace_lane 1 (local.get 0) (i32.load16_u (local.get 1))) return)
  (func $i16x8.replace_lane_2 (param v128 i32) (result v128) (i16x8.replace_lane 2 (local.get 0) (i32.load16_u (local.get 1))) return)
  (func $i16x8.replace_lane_3 (param v128 i32) (result v128) (i16x8.replace_lane 3 (local.get 0) (i32.load16_u (local.get 1))) return)
  (func $i16x8.replace_lane_4 (param v128 i32) (result v128) (i16x8.replace_lane 4 (local.get 0) (i32.load16_u (local.get 1))) return)
  (func $i16x8.replace_lane_5 (param v128 i32) (result v128) (i16x8.replace_lane 5 (local.get 0) (i32.load16_u (local.get 1))) return)
  (func $i16x8.replace_lane_6 (param v128 i32) (result v128) (i16x8.replace_lane 6 (local.get 0) (i32.load16_u (local.get 1))) return)
  (func $i16x8.replace_lane_7 (param v128 i32) (result v128) (i16x8.replace_lane 7 (local.get 0) (i32.load16_u (local.get 1))) return)

  (func $i16x8.extract_lane_0 (param i32 v128) (i32.store16 (local.get 0) (i16x8.extract_lane_u 0 (local.get 1))) return)
  (func $i16x8.extract_lane_1 (param i32 v128) (i32.store16 (local.get 0) (i16x8.extract_lane_u 1 (local.get 1))) return)
  (func $i16x8.extract_lane_2 (param i32 v128) (i32.store16 (local.get 0) (i16x8.extract_lane_u 2 (local.get 1))) return)
  (func $i16x8.extract_lane_3 (param i32 v128) (i32.store16 (local.get 0) (i16x8.extract_lane_u 3 (local.get 1))) return)
  (func $i16x8.extract_lane_4 (param i32 v128) (i32.store16 (local.get 0) (i16x8.extract_lane_u 4 (local.get 1))) return)
  (func $i16x8.extract_lane_5 (param i32 v128) (i32.store16 (local.get 0) (i16x8.extract_lane_u 5 (local.get 1))) return)
  (func $i16x8.extract_lane_6 (param i32 v128) (i32.store16 (local.get 0) (i16x8.extract_lane_u 6 (local.get 1))) return)
  (func $i16x8.extract_lane_7 (param i32 v128) (i32.store16 (local.get 0) (i16x8.extract_lane_u 7 (local.get 1))) return)

  (func (export "4-byte-from-end") (param i32)
    (drop (call $v128.load32_splat (local.get 0)))

    (drop (call $v128.load32_lane_0 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load32_lane_1 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load32_lane_2 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load32_lane_3 (local.get 0) (v128.const i64x2 0 0)))

    (call $v128.store32_lane_0 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store32_lane_1 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store32_lane_2 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store32_lane_3 (local.get 0) (v128.const i64x2 0 0))

    (drop (call $i32x4.replace_lane_0 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i32x4.replace_lane_1 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i32x4.replace_lane_2 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i32x4.replace_lane_3 (v128.const i64x2 0 0) (local.get 0)))

    (drop (call $f32x4.replace_lane_0 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $f32x4.replace_lane_1 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $f32x4.replace_lane_2 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $f32x4.replace_lane_3 (v128.const i64x2 0 0) (local.get 0)))

    (call $i32x4.extract_lane_0 (local.get 0) (v128.const i64x2 0 0))
    (call $i32x4.extract_lane_1 (local.get 0) (v128.const i64x2 0 0))
    (call $i32x4.extract_lane_2 (local.get 0) (v128.const i64x2 0 0))
    (call $i32x4.extract_lane_3 (local.get 0) (v128.const i64x2 0 0))

    (call $f32x4.extract_lane_0 (local.get 0) (v128.const i64x2 0 0))
    (call $f32x4.extract_lane_1 (local.get 0) (v128.const i64x2 0 0))
    (call $f32x4.extract_lane_2 (local.get 0) (v128.const i64x2 0 0))
    (call $f32x4.extract_lane_3 (local.get 0) (v128.const i64x2 0 0))
  )

  (func $v128.load32_splat (param i32) (result v128) (v128.load32_splat (local.get 0)) return)

  (func $v128.load32_lane_0 (param i32 v128) (result v128) (v128.load32_lane 0 (local.get 0) (local.get 1)) return)
  (func $v128.load32_lane_1 (param i32 v128) (result v128) (v128.load32_lane 1 (local.get 0) (local.get 1)) return)
  (func $v128.load32_lane_2 (param i32 v128) (result v128) (v128.load32_lane 2 (local.get 0) (local.get 1)) return)
  (func $v128.load32_lane_3 (param i32 v128) (result v128) (v128.load32_lane 3 (local.get 0) (local.get 1)) return)

  (func $v128.store32_lane_0 (param i32 v128) (v128.store32_lane 0 (local.get 0) (local.get 1)) return)
  (func $v128.store32_lane_1 (param i32 v128) (v128.store32_lane 1 (local.get 0) (local.get 1)) return)
  (func $v128.store32_lane_2 (param i32 v128) (v128.store32_lane 2 (local.get 0) (local.get 1)) return)
  (func $v128.store32_lane_3 (param i32 v128) (v128.store32_lane 3 (local.get 0) (local.get 1)) return)

  (func $i32x4.replace_lane_0 (param v128 i32) (result v128) (i32x4.replace_lane 0 (local.get 0) (i32.load (local.get 1))) return)
  (func $i32x4.replace_lane_1 (param v128 i32) (result v128) (i32x4.replace_lane 1 (local.get 0) (i32.load (local.get 1))) return)
  (func $i32x4.replace_lane_2 (param v128 i32) (result v128) (i32x4.replace_lane 2 (local.get 0) (i32.load (local.get 1))) return)
  (func $i32x4.replace_lane_3 (param v128 i32) (result v128) (i32x4.replace_lane 3 (local.get 0) (i32.load (local.get 1))) return)

  (func $f32x4.replace_lane_0 (param v128 i32) (result v128) (f32x4.replace_lane 0 (local.get 0) (f32.load (local.get 1))) return)
  (func $f32x4.replace_lane_1 (param v128 i32) (result v128) (f32x4.replace_lane 1 (local.get 0) (f32.load (local.get 1))) return)
  (func $f32x4.replace_lane_2 (param v128 i32) (result v128) (f32x4.replace_lane 2 (local.get 0) (f32.load (local.get 1))) return)
  (func $f32x4.replace_lane_3 (param v128 i32) (result v128) (f32x4.replace_lane 3 (local.get 0) (f32.load (local.get 1))) return)

  (func $i32x4.extract_lane_0 (param i32 v128) (i32.store (local.get 0) (i32x4.extract_lane 0 (local.get 1))) return)
  (func $i32x4.extract_lane_1 (param i32 v128) (i32.store (local.get 0) (i32x4.extract_lane 1 (local.get 1))) return)
  (func $i32x4.extract_lane_2 (param i32 v128) (i32.store (local.get 0) (i32x4.extract_lane 2 (local.get 1))) return)
  (func $i32x4.extract_lane_3 (param i32 v128) (i32.store (local.get 0) (i32x4.extract_lane 3 (local.get 1))) return)

  (func $f32x4.extract_lane_0 (param i32 v128) (f32.store (local.get 0) (f32x4.extract_lane 0 (local.get 1))) return)
  (func $f32x4.extract_lane_1 (param i32 v128) (f32.store (local.get 0) (f32x4.extract_lane 1 (local.get 1))) return)
  (func $f32x4.extract_lane_2 (param i32 v128) (f32.store (local.get 0) (f32x4.extract_lane 2 (local.get 1))) return)
  (func $f32x4.extract_lane_3 (param i32 v128) (f32.store (local.get 0) (f32x4.extract_lane 3 (local.get 1))) return)

  (func (export "8-byte-from-end") (param i32)
    (drop (call $v128.load64_splat (local.get 0)))

    (drop (call $v128.load64_lane_0 (local.get 0) (v128.const i64x2 0 0)))
    (drop (call $v128.load64_lane_1 (local.get 0) (v128.const i64x2 0 0)))

    (call $v128.store64_lane_0 (local.get 0) (v128.const i64x2 0 0))
    (call $v128.store64_lane_1 (local.get 0) (v128.const i64x2 0 0))

    (drop (call $i64x2.replace_lane_0 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $i64x2.replace_lane_1 (v128.const i64x2 0 0) (local.get 0)))

    (drop (call $f64x2.replace_lane_0 (v128.const i64x2 0 0) (local.get 0)))
    (drop (call $f64x2.replace_lane_1 (v128.const i64x2 0 0) (local.get 0)))

    (call $i64x2.extract_lane_0 (local.get 0) (v128.const i64x2 0 0))
    (call $i64x2.extract_lane_1 (local.get 0) (v128.const i64x2 0 0))

    (call $f64x2.extract_lane_0 (local.get 0) (v128.const i64x2 0 0))
    (call $f64x2.extract_lane_1 (local.get 0) (v128.const i64x2 0 0))
  )

  (func $v128.load64_splat (param i32) (result v128) (v128.load64_splat (local.get 0)) return)

  (func $v128.load64_lane_0 (param i32 v128) (result v128) (v128.load64_lane 0 (local.get 0) (local.get 1)) return)
  (func $v128.load64_lane_1 (param i32 v128) (result v128) (v128.load64_lane 1 (local.get 0) (local.get 1)) return)

  (func $v128.store64_lane_0 (param i32 v128) (v128.store64_lane 0 (local.get 0) (local.get 1)) return)
  (func $v128.store64_lane_1 (param i32 v128) (v128.store64_lane 1 (local.get 0) (local.get 1)) return)

  (func $i64x2.replace_lane_0 (param v128 i32) (result v128) (i64x2.replace_lane 0 (local.get 0) (i64.load (local.get 1))) return)
  (func $i64x2.replace_lane_1 (param v128 i32) (result v128) (i64x2.replace_lane 1 (local.get 0) (i64.load (local.get 1))) return)

  (func $f64x2.replace_lane_0 (param v128 i32) (result v128) (f64x2.replace_lane 0 (local.get 0) (f64.load (local.get 1))) return)
  (func $f64x2.replace_lane_1 (param v128 i32) (result v128) (f64x2.replace_lane 1 (local.get 0) (f64.load (local.get 1))) return)

  (func $i64x2.extract_lane_0 (param i32 v128) (i64.store (local.get 0) (i64x2.extract_lane 0 (local.get 1))) return)
  (func $i64x2.extract_lane_1 (param i32 v128) (i64.store (local.get 0) (i64x2.extract_lane 1 (local.get 1))) return)

  (func $f64x2.extract_lane_0 (param i32 v128) (f64.store (local.get 0) (f64x2.extract_lane 0 (local.get 1))) return)
  (func $f64x2.extract_lane_1 (param i32 v128) (f64.store (local.get 0) (f64x2.extract_lane 1 (local.get 1))) return)
)

(assert_return (invoke "1-byte-from-end" (i32.const 65535)))
(assert_return (invoke "2-byte-from-end" (i32.const 65534)))
(assert_return (invoke "4-byte-from-end" (i32.const 65532)))
(assert_return (invoke "8-byte-from-end" (i32.const 65528)))
